import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

let player = ref(null)
export { player }
export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  const doubleCount = computed(() => count.value * 2)
  function increment() {
    count.value++
  }

  return { count, doubleCount, increment }
})


export const useAudioPlayListStore = defineStore('audioPlayList', () => {
  const audioPlayList = ref([])
  function setAudioPlayList(list) {
    audioPlayList.value = list
  }
  return { audioPlayList, setAudioPlayList }
})

export const useAudioPlayer = defineStore('audioPlayer', () => {
  const audioPlayer = ref([])
  function setAudioPlayer(player) {
    audioPlayer.value = player
  }
  return { audioPlayer, setAudioPlayer }
})